package summer_vacation.yangyiqing.m201508;
import java.util.Scanner;

/**
 * Created by Administrator on 2015/9/1 0001.
 */
public class Java_27 {
    public static void main(String[] args){
        System.out.println("请输入a,b,c的值：");
        Scanner s=new Scanner(System.in);
        double a=s.nextDouble();
        double b=s.nextDouble();
        double c=s.nextDouble();
        double t=0;
        double x1=0,x2=0;
        t=b*b-4*a*c;
        int a1=(int)a;
        int b1=(int)b;
        int c1=(int)c;
        System.out.println(a1+"x*x"+b1+"x"+c1+"=0的解是");
        if(t<0){
            System.out.println("该方程无解！");
        }else{
            x1=(-b+Math.pow(t,0.5))/2*a;
            x2=(b-Math.pow(t,0.5))/2*a;
            System.out.println("该方程有解 x1="+x1+" x2="+x2);
        }
    }
}
